defineReplace(qtLibraryName) {
   unset(LIBRARY_NAME)
   LIBRARY_NAME = $$1
   CONFIG(debug, debug|release) {
      !debug_and_release|build_pass {
          mac:RET = $$member(LIBRARY_NAME, 0)_debug
              else:win32:RET = $$member(LIBRARY_NAME, 0)d
      }
   }

   isEmpty(RET):RET = $$LIBRARY_NAME
   return($$RET)
}

#指定生成的应用程序放置的目录
#.pri文件所在的位置
IDE_SOURCE_TREE = $$PWD
IDE_BUILD_TREE  = $$IDE_SOURCE_TREE/../
#message($$IDE_SOURCE_TREE)

#指定生成的临时文件放置的目录
win32:CONFIG(debug, debug|release){
    MOC_DIR = debug/moc
    RCC_DIR = debug/rcc
    UI_DIR = debug/ui
    OBJECTS_DIR = debug/obj
} else:win32:CONFIG(release, debug|release){
    MOC_DIR = release/moc
    RCC_DIR = release/rcc
    UI_DIR = release/ui
    OBJECTS_DIR = release/obj
}

macx {
    IDE_APP_PATH = $$IDE_BUILD_TREE/bin
    IDE_LIBRARY_PATH = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/PlugIns
    IDE_PLUGIN_PATH = $$IDE_LIBRARY_PATH
    IDE_DATA_PATH = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/Resources
    IDE_BIN_PATH = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/MacOS
    contains(QT_CONFIG, ppc):CONFIG += ppc x86
    copydata = 1
} else {
    IDE_BIN_PATH = $$IDE_BUILD_TREE/bin
    IDE_LIBRARY_PATH = $$IDE_BUILD_TREE/lib
    IDE_PLUGIN_PATH = $$IDE_LIBRARY_PATH/plugins
    IDE_DATA_PATH = $$IDE_BUILD_TREE/data
    !isEqual(IDE_SOURCE_TREE, $$IDE_BUILD_TREE):copydata = 1
}

win32:CONFIG(debug, debug|release){
    contains(DEFINES, WIN64) {
    DESTDIR = $$IDE_BUILD_TREE/_debug64
    } else {
    DESTDIR = $$IDE_BUILD_TREE/_debug86
    }
} else:win32:CONFIG(release, debug|release){
    contains(DEFINES, WIN64) {
    DESTDIR = $$IDE_BUILD_TREE/_release64
    } else {
    DESTDIR = $$IDE_BUILD_TREE/_release86
    }
}

macx:CONFIG(debug, debug|release){
    DESTDIR = $$IDE_BUILD_TREE/_debug64
} else:macx:CONFIG(release, debug|release){
    DESTDIR = $$IDE_BUILD_TREE/_release64
}

#Release禁止输出qWarning/qDebug信息
CONFIG (release, debug|release) {
DEFINES += QT_NO_WARNING_OUTPUT
DEFINES += QT_NO_DEBUG_OUTPUT
}

linux-g++-* {
    # Bail out on non-selfcontained libraries. Just a security measure
    # to prevent checking in code that does not compile on other platforms.
    QMAKE_LFLAGS += -Wl,--allow-shlib-undefined -Wl,--no-undefined
}

win32-msvc* {
    #Don't warn about sprintf, fopen etc being 'unsafe'
    DEFINES += _CRT_SECURE_NO_WARNINGS

    QMAKE_CXXFLAGS += /MP
    QMAKE_CFLAGS += /MP

    QMAKE_CXXFLAGS -= /Gm
    QMAKE_CFLAGS -= /Gm
}

linux* {
    contains(CONFIG, gl_qtwebkit) {
        DEFINES += GL_QTWEBKIT
    }
} else {
    greaterThan(QT_MAJOR_VERSION, 4) {
    } else {
        DEFINES += GL_QTWEBKIT
    }
}

#Release编译,生成*.pdb调试文件
QMAKE_CXXFLAGS_RELEASE += $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
QMAKE_LFLAGS_RELEASE += $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO
